package com.nuoniu.sibanyun.controller.crm.call;


import com.nuoniu.sibanyun.common.BaseController;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.crm.call.dto.CrmCallTaskDetailSaveDto;
import com.nuoniu.sibanyun.entity.crm.call.dto.CrmCallTaskDetailSearchDto;
import com.nuoniu.sibanyun.service.crm.call.ICrmCallTaskDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 客户管理-外呼管理-外呼任务明细 前端控制器
 * </p>
 *
 * @author 白强
 * @since 2022-03-03
 */
@RestController
@RequestMapping("/crm/callTaskDetail")
@Api(tags = "客户管理-外呼管理-外呼任务明细")
public class CrmCallTaskDetailController extends BaseController {

    @Autowired
    private ICrmCallTaskDetailService callTaskDetailService;

    @PostMapping("list")
    @ApiOperation(value = "查询 任务明细")
    public HttpResult listTaskDetail(@RequestBody CrmCallTaskDetailSearchDto crmCallTaskDetailSearchDto) {
        return HttpResult.ok(callTaskDetailService.listTaskDetail(crmCallTaskDetailSearchDto));
    }

    @PostMapping("addCallTaskDetail")
    @ApiOperation(value = "从 现有客户中  添加 联系人 到任务明细")
    public HttpResult addCallTaskDetail(@RequestBody CrmCallTaskDetailSaveDto crmCallTaskDetailSaveDto){
        callTaskDetailService.addCallTaskDetail(crmCallTaskDetailSaveDto);
        return HttpResult.ok();
    }

    @DeleteMapping("batchDelete")
    @ApiOperation(value = "批量删除")
    public HttpResult batchDelete(Long taskId,String ids){
        callTaskDetailService.batchDelete(taskId, ids);
        return HttpResult.ok();
    }


}
